package cn.gson.boot.model.dao;

import cn.gson.boot.model.pojos.Jiaofujihua;
import cn.gson.boot.model.pojos.Jiaofujihuaxiangqing;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.transaction.Transactional;

public interface JiaoFuJiHuaXiangQinDao extends CrudRepository<Jiaofujihuaxiangqing,Integer> {
    //修改后台时会重复新增交付计划详情，所以先根据交付计划id删除一下
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "delete from jiaofujihuaxiangqing where jj_id = ?1")
    public void deleteJiaoFuJiHuaXiangQing(Integer jjId);

    /*//新建交付计划
    @Query(nativeQuery = true,value = "select * from hetong where ht_zhuangtai = '执行中' and ht_ys = 1 order by ht_id desc")
    public List<Jiaofujihua> addJiaoFuJiHua();*/

}
